home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 239_01 / wprintf.c < prev    next >
Text File  |  1987-07-29  |  640b  |  29 lines

  1.  
  2. #include <stdarg.h>
  3. #include <malloc.h>
  4. #include "ciao.h"
  5.  
  6. /* wprintf -- printf formatted string into window
  7. **            honors all the wputs ^ attribute escape commands
  8. **
  9. ** example:
  10. **   wprintf("Well, now, here are  ^1three^ little ^6%c%c%c^'s!\n",2,1,2);
  11. **
  12. */
  13.  
  14. void wprintf( fmt )
  15. char *fmt;
  16. {
  17.      char *q;
  18.      va_list arg_ptr;
  19.  
  20.      q = (char *) malloc(128);
  21.      va_start( arg_ptr, fmt );
  22.      vsprintf( q, fmt, arg_ptr );
  23.      va_end( arg_ptr );
  24.      wputs( q );
  25.      free( q );
  26. }
  27.  
  28.  
  29.